package com.feng.service;

import com.feng.dao.WrongBillDao;
import com.feng.model.WrongBill;
import com.feng.util.PageResult;
import com.feng.util.Search;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 代理商Service
 */
@Service
public class WrongBillService extends BaseService<WrongBill>{

	protected static Logger log = LogManager.getLogger(WrongBillService.class);

	@Autowired
	protected WrongBillDao wrongBillDao;

	/**
	 * 
	 * @param search
	 * @return
	 * */
	@Transactional(readOnly=true)
	public PageResult<WrongBill> findByPage(Search search) throws Exception{
			return wrongBillDao.findByPage(search);
	}

	@Transactional
	public void delByAccount(Long op){
			baseDao.excuteSqlUpdate("delete from wrong_bill where op = ?",op);
	}

	@Transactional(readOnly=true)
	public WrongBill getByInsuranceNo(String insuranceNo) {
		return wrongBillDao.findByNo(insuranceNo);
	}

}
